package model;

//file handlers
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.File;
//xml handlers
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
//general utility classes
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.List;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Iterator;


public class AcolyteGame
{
  //parameters of the game
  AcolyteGameType gameType;
  //list of players in the game
  List<AcolytePlayer> players;
  //keep track of whose turn it is
  Iterator<AcolytePlayer> turnOrder;
  //the player whose turn it currently is
  AcolytePlayer activePlayer;
  //keep track of the current phase
  Iterator<String> phases;
  //the current phas
  String phase;
  
  
  //Game loop
  //preconditions all players that are going to play are somehow connected
  //gameType and decks are well defined
  
  //possible actions:
  //player can observe a zone
  //player can attempt to move a card from a zone to another zone
  //player can end a phase(if s/he ends the last phase then s/he ends his or her turn)
  
  public void endPhase()
  {
    
    //give non-active players a chance to respond
    
    //go to the next phase if there is one
    if(phases.hasNext())
    {
      phase = phases.next();
    }
    //go to the next players turn if there isnt a next phase
    else
    {
    }
  }
  
  //try and set a property of the targetPlayer, usually life
  public void setProperty(AcolytePlayer targetPlayer, String name, String value)
  {
  }
  
  //viewingPlayer is trying to view targetPlayer's zone "zone"
  public List<AcolyteCard> viewZone(AcolytePlayer viewingPlayer, String zone, AcolytePlayer targetPlayer)
  {
    //ask targetPlayer for permission to show viewingPlayer their zone if viewingPlayer != ActivePlayer
    return null;
  }
  
  //actingPlayer is trying to move card from where it is to targetPlayer's zone targetZone
  public void moveCard(AcolytePlayer actingPlayer, AcolyteCard card, String targetZone, AcolytePlayer targetPlayer)
  {
    //ask card's controller permission if not activePlayer
    //ask targetPlayer's permission if not activePlayer
  }
}